<template>
	<view class="searchInput">
		<vanSearch
		  v-model="searchText"
		  shape="round"
		  placeholder="请输入搜索关键词"
		  @change.native="setSearchText"
		  @search="onSearch"
		  background="#99D28D"
		>
		</vanSearch>
	</view>
</template>

<script>
	import vanSearch from '@/wxcomponents/vant/@vant/search'
	import {setHistoryKeys} from '@/utils/index.js'
	export default{
		components:{
			vanSearch
		},
		data(){
			return{
				searchText:''
			};
		},
		methods:{
			onSearch(){
				console.log(this.searchText)
				setHistoryKeys(this.searchText)
				uni.navigateTo({
					url: `/packageA/pages/product/product?keyWord=`+this.searchText,
				})
			},
			setSearchText(e){
				console.log(e)
				this.searchText = e.detail
			}
		}
	}
</script>

<style lang="less">
	
</style>